<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2021/3/23 0023
 * Time: 下午 2:47
 */

namespace app\admin\model;


use think\Model;

class ArticleInfoModel extends Model
{
    protected $table = "article_info";

    static public function addDetail($data)
    {
        $model = new self();
        $result = $model->allowField(true)->save($data);
        return $result;
    }

    static public function editDetail($data)
    {
        $model = new self();
        $arrData = [
            "detail" => $data["detail"],
            "headImgSrc" => $data["headImgSrc"]
        ];
        $result = $model->save($arrData,["article_id" => $data["article_id"]]);
        return $result;
    }
}